/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.promotion;

import com.enation.app.javashop.client.promotion.PromotionScriptClient;
import com.enation.app.javashop.core.client.fallback.promotion.PromotionGoodsClientFallbackFactory;
import com.enation.app.javashop.core.client.fallback.promotion.PromotionScriptClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.promotion.seckill.dos.SeckillApplyDO;
import com.enation.app.javashop.model.promotion.tool.dos.PromotionGoodsDO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 促销脚本客户端
 *
 * @author fk
 * @version v7.0
 * @date 19/3/28 上午11:10
 * @since v7.0
 */
@FeignClient(name = "promotion-service", fallbackFactory = PromotionScriptClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface PromotionScriptClientFeignImpl extends PromotionScriptClient {

    /**
     * 创建参与团购促销活动商品的脚本数据信息
     * @param promotionId 团购促销活动ID
     * @param goodsList 参与团购促销活动的商品集合
     */
    @Override
    @RequestMapping(value = "/client/promotion/{promotion_id}/script/group-buy", method = RequestMethod.POST)
    void createGroupBuyCacheScript(@PathVariable("promotion_id") Long promotionId,@RequestBody List<PromotionGoodsDO> goodsList);

    /**
     * 删除商品存放在缓存中的团购促销活动相关的脚本数据信息
     * @param promotionId 团购促销活动ID
     * @param goodsList 参与团购促销活动的商品集合
     */
    @Override
    @RequestMapping(value = "/client/promotion/{promotion_id}/script/group-buy", method = RequestMethod.DELETE)
    void deleteGroupBuyCacheScript(@PathVariable("promotion_id") Long promotionId,@RequestBody List<PromotionGoodsDO> goodsList);

    /**
     * 删除商品存放在缓存中的限时抢购促销活动相关的脚本数据信息
     * @param promotionId 限时抢购促销活动ID
     * @param goodsList 参与限时抢购促销活动的商品集合
     */
    @Override
    @RequestMapping(value = "/client/promotion/{promotion_id}/script/seckill", method = RequestMethod.DELETE)
    void deleteCacheScript(@PathVariable("promotion_id") Long promotionId,@RequestBody List<SeckillApplyDO> goodsList);


}
